<template>
  <el-container>
    <div class='shop-frame'>
      <el-form autoComplete="on" :model="userForm" :rules="userRules" ref="userForm" label-width="120px"
        label-position="right" class="card-box shop-form">
        <el-form-item class="inp" prop="stuName" label="姓名：" style="width: 80%;">
          <el-input name='stuName' v-model="userForm.stuName" autoComplete="on" clearable />
        </el-form-item>
        <el-form-item class="inp" prop="stuNum" label="学号：" style="width: 80%;">
          <el-input name='stuNum' v-model="userForm.stuNum" autoComplete="on" clearable />
        </el-form-item>
        <el-form-item class="inp" prop="stuSex" label="性别：" style="width: 80%;">
          <el-input name='stuSex' v-model="userForm.stuSex" autoComplete="on" clearable />
        </el-form-item>
        <el-form-item class="inp" prop="stuDep" label="院系：" style="width: 80%;">
          <el-input name='stuDep' v-model="userForm.stuDep" autoComplete="on" clearable />
        </el-form-item>
        <el-form-item class="inp" prop="phone" label="电话：" style="width: 80%;">
          <el-input name='phone' v-model="userForm.phone" autoComplete="on" clearable />
        </el-form-item>
        <el-form-item class="inp" prop="issue" label="问题类型：" style="width: 80%;">
          <el-input name='issue' v-model="userForm.issue" autoComplete="on" clearable />
        </el-form-item>
        <p>1．我觉得闷闷不乐,情绪低沉</p>
        <el-radio-group v-model="radio">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>
        <p>2我觉得一天之中早晨最好</p>
        <el-radio-group v-model="radio1">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>3．我一阵阵哭出来或想哭</p>
        <el-radio-group v-model="radio2">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>4．我晚上睡眠不好</p>
        <el-radio-group v-model="radio3">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>5．我吃得跟平常一样多</p>
        <el-radio-group v-model="radio4">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>6.我与异性密切接触时和以往一样感到愉快</p>
        <el-radio-group v-model="radio5">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>7．我发觉我的体重在下降</p>
        <el-radio-group v-model="radio6">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>8．我有便秘的苦恼</p>
        <el-radio-group v-model="radio7">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>9．我心跳比平时快</p>
        <el-radio-group v-model="radio8">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>10.我无缘无故地感到疲乏</p>
        <el-radio-group v-model="radio9">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>11．我的头脑跟平常一样清楚</p>
        <el-radio-group v-model="radio10">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>12.我觉得经常做的事情并没困难</p>
        <el-radio-group v-model="radio11">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>13．我觉得不安而平静不下来</p>
        <el-radio-group v-model="radio12">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>14．我对将来抱有希望</p>
        <el-radio-group v-model="radio13">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>15．我比平常容易生气激动</p>
        <el-radio-group v-model="radio14">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>16．我觉得作出决定是容易的</p>
        <el-radio-group v-model="radio15">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>17.我觉得自己是个有用的人,有人需要我</p>
        <el-radio-group v-model="radio16">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>18.我的生活过得很有意思</p>
        <el-radio-group v-model="radio17">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>19.我认为切果我死了别人会生活得更好些</p>
        <el-radio-group v-model="radio18">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>

        <p>20.平常感兴趣的事我仍然照样感兴趣</p>
        <el-radio-group v-model="radio19">
          <el-radio label="1">偶有</el-radio>
          <el-radio label="2">有时</el-radio>
          <el-radio label="3">经常</el-radio>
          <el-radio label="4">持续</el-radio>
        </el-radio-group>
        <p style="font-weight: bold;">尊敬的来访者： 感谢您的信任。在正式开始咨询之前，有些相关事宜需要告知于您，以便咨询更好地开展，请您阅读后在勾选已阅读按钮，以表明您已经仔细阅读过并同意这些条款。
        </p>
        <div class="studentList-btn">
          <el-button class="formBtn" @click="messageDialogVisible = true">
            同意
          </el-button>
          <el-button class="formBtn" @click="handleComplaint()">
            提交
          </el-button>
        </div>
      </el-form>
      <el-dialog :visible.sync="messageDialogVisible" title="发送消息" @close="messageDialogVisible = false" width="650px"
        :close-on-click-modal="false" center>
        <div class='shop-frame'>
          <p>尊敬的来访者：</p>

          <p>感谢您的信任。在正式开始咨询之前，有些相关事宜需要告知于您，以便咨询更好地开展，咨询更好地开展，请您阅读后在勾选已阅读按钮，以表明您已经仔细阅读过并同意这些条款。
          </p>
          <p> 1、收费设置：</p>
          <p> 咨询师的收费标准是 200元/50分钟。费用按月结算，月末支付。如果您想预约时间，请至少提前24小时打电话或邮件告知，电话号码：123456789
            邮箱：12345@happyevery.com。如果您已经约定时间，需要临时取消，请提前一天通知；如果您在约好的时间未通知我们取消而不来应诊，您有责任支付您所约定当次的咨询费用。连续两次未能提前24小时通知而不来应诊，将视为您取消之后所有预约的咨询。
          </p>
          <p> 2、保密性：</p>
          <p>在一般情况下，咨询师对您所提供的信息保密，包括个案记录、测验资料、信件、录音、录像和其他资料，均属专业信息，在严格保密的情况下进行保存，避免在任何公众场合公开；
          </p>
          <p>3、来访者的责任：</p>

          <p>来访者在咨询工作中需要做到：1）参加并参与咨询面谈；2）按照协议付费；3）在咨询中尽可能表达和分享自己的想法和感受；4）认真思考自己的表达、咨询师的回应以及二人的互动交流过程。
          </p>
          <p>4、咨询师的责任：</p>

          <p>
            咨询师在咨询工作中需要做到：1）为来访者安排双方合适的咨询日程；2）努力帮助来访者通向对自我、现状的理解、帮助来访者更好地处理当下面临的种种困苦以及生活事件；3）定期参加专业学习和案例讨论会，确保自己胜任与来访者的咨询工作；4）清楚自己的身为咨询师的有限性，在咨询无效、失败的时候及时与来访者讨论结束咨询、转介等事宜。
          </p>
          <el-button class="formBtn" @click="messageDialogVisible = false">
           确定
          </el-button>
        </div>
      </el-dialog>
    </div>
  </el-container>
</template>
<script>
  import {
    addRegister
  } from '@/api/registerRecord'

  export default {
    data() {
      return {
        messageDialogVisible: false,
        radio: '1',
        radio1: '1',
        radio2: '1',
        radio3: '1',
        radio4: '1',
        radio5: '1',
        radio6: '1',
        radio7: '1',
        radio8: '1',
        radio9: '1',
        radio10: '1',
        radio11: '1',
        radio12: '1',
        radio13: '1',
        radio14: '1',
        radio15: '1',
        radio16: '1',
        radio17: '1',
        radio18: '1',
        radio19: '1',
        userRules: {
          stuSex: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }],
          stuDep: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }],
          stuName: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }],
          stuNum: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }],
          phone: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }],
          issue: [{
            required: true,
            message: '不能为空',
            trigger: 'blur'
          }]
        },
        userForm: {}
      }
    },
    methods: {
      handleComplaint() {
        var issueScore = Number(this.radio) + Number(this.radio1) + Number(this.radio2) + Number(this.radio3) + Number(
            this.radio4) + Number(this.radio5) +
          Number(this.radio6) + Number(this.radio7) + Number(this.radio8) + Number(this.radio9) + Number(this.radio10) +
          Number(this.radio11) + Number(this.radio12) + Number(this.radio13) + Number(this
            .radio14) + Number(this.radio15) + Number(this.radio16) + Number(this.radio17) + Number(this.radio18) +
          Number(this.radio19)
        this.userForm.issueScore = issueScore
        addRegister(this.userForm).then(resp => {
          this.$router.push("/dashboard")
        })
      }
    }
  }

</script>
